package com.xcity.pomelo.response;

import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.xcity.game.pet.Pet;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class PetListResponse extends Response {

	private PetInfo[] list;
	
	public static class PetInfo extends PetInfoResponse {
		public PetInfo(Pet pet) {
			super(0, pet);
		}
		@JSONField(serialize = false)
		public short getCode() {
			return code;
		}
	}
	
	public PetListResponse(int serial, List<Pet> pets) {
		super(serial);
		list = new PetInfo[pets.size()];
		for (int i = 0; i < pets.size(); i++) {
			list[i] = new PetInfo(pets.get(i));
		}
	}

	public PetInfo[] getList() {
		return list;
	}

	public void setList(PetInfo[] list) {
		this.list = list;
	}


}
